#字符串CRUD操作
content_a = "student"
content_b = "python"

#增加create
content_c = content_a + content_b
print(content_c)
"studentpython"

#检索（tetrieve)

    #find和index
    content_a.find("d")
    3
    content_a.find("z")
    -1
    content_b.index("y")
    1
    content_b.index("z")
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    NameError: name 'content' is not defined

    #stratswith和endswith
    "student".stratswith("stu")
    True
    "python".endswith("on")
    True

    #索引
    content_a[2:3]
    'u'
    content_a[2:]
    'udent'
    content_a[:3]
    'stu'
    content_b[:]
    'python'

#更新（update)
    #replace
    content_a.replace("s","d")
    'dtudent'
    #split
    date_str = "2020-11-01 20:30"
    date_str.split(" ")
    ['2020-11-01','20:30']
    #join
    tmp = date_str(" ")
    "2020-11-01 20:30"
#删除（delete）
    #strip(删除两端）
    " student python ".strip(" ")=="student python"
    True
    #lstrip(删除前端）
    " student python ".lstrip(" ")=="student python "
    True
    #rstrip(删除后端）
    " student python ".rstrip(" ")==" student python"
    True
#字符串格式化输出format
    #按传入参数的默认顺序
    "{}-{}-01".format("2020","11")
    '2020-11-01'
    #按指定参数索引
    "{2}-{1}-{0}".format("啊","好","你")
    '你-好-啊'
    #按关键词
    "{city}-{name}".format(city = "tianjin",name = "qingpingzhimo")
    'tianjin-qingpingzhimo'
    #按变量
    f"{city}-qingpingzhimo"
    'tianjin-qingpingzhimo'
    #浮点数处理
    "{:.3f}".format(3.1415926)
    '3.142'








